package com.android.antelopeapp;

import android.app.Application;
import android.util.Log;

import com.alibaba.sdk.android.AlibabaSDK;
import com.allthelucky.common.view.network.NetworkApp;
import com.android.antelopeapp.network.LruBitmapCache;
import com.android.antelopeapp.network.NetworkManager;
import com.android.volley.toolbox.ImageLoader;
import com.taobao.tae.sdk.TaeSDK;
import com.taobao.tae.sdk.callback.InitResultCallback;

/**
 * application类
 * 用于管理整个application
 * */

public class AntelpopApplication extends Application {
    @Override
    public void onCreate() {
        // TODO Auto-generated method stub
        super.onCreate();
        initBC();
        NetworkApp.setImageLoader(NetworkManager.getInstance(this).getImageLoader());
    }

    /**
     * 初始化阿里百川
     * */
    public void initBC(){
        //  1或者不设置代表生产环境，3代表沙箱环境，在TaeSDK.asyncInit前调用
        //TaeSDK.setEnvIndex(3);

        AlibabaSDK.asyncInit(this, new InitResultCallback() {

            @Override
            public void onSuccess() {
                Log.v("APP", "baichuan init successfully!");
            }

            @Override
            public void onFailure(int code, String message) {
                Log.v("APP", "baichuan init failue! code:"+code+" message:"+message);
            }

        });
    }
}
